<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<html>
<head>
	<title>服务网点管理</title>
	
	<script>
		$(document).ready(function() {
			//聚焦第一个输入框
			$("#areaGroup_groupName").focus();
			//为inputForm注册validate函数
			$("#inputForm").validate();
		});
	</script>
</head>

<body>
	<form id="inputForm" action="${ctx}/areaGroup/${action}" method="post" class="form-horizontal">
		<input type="hidden" name="id" value="${areaGroup.id}"/>
		<fieldset>
			<legend><small>管理服务网点</small></legend>
			<div class="control-group">
				<label for="areaGroup_groupName" class="control-label">网点名称:</label>
				<div class="controls">
					<input type="text" id="areaGroup_groupName" name="groupName"  value="${areaGroup.groupName}" class="input-large required" minlength="1" maxlength="20"/>
				</div>
			</div>
			<div class="control-group">
				<label for="areaGroup_groupCode" class="control-label">网点编码:</label>
				<div class="controls">
					<input type="text" id="areaGroup_groupCode" name="groupCode"  value="${areaGroup.groupCode}" class="input-large required" minlength="1" maxlength="20"/>
				</div>
			</div>
			<div class="control-group">
				<label for="areaGroup_groupIntro" class="control-label">网点信息:</label>
				<div class="controls">
					<input type="text" id="areaGroup_groupIntro" name="groupIntro"  value="${areaGroup.groupIntro}" class="input-large required" minlength="1" maxlength="20"/>
				</div>
			</div>
			<div class="control-group">
				<label for="areaGroup_provinces" class="control-label">覆盖的省份:</label>
				<div class="controls">
					<select id="areaGroup_provinces" name="provinces" multiple="multiple">
						<c:forEach items="${provinces}" var="province">
							<option value="${province.areaCode}" <c:forEach items="${currentProvinces}" var="currentProvince"><c:if test="${currentProvince eq province.areaCode}">selected="selected"</c:if></c:forEach>>
								${province.areaName}
							</option>
						</c:forEach>
					</select>
				<div>按住「ctrl」+ 鼠标左击可以多选</div>
				</div>
				
			</div>
			<div class="form-actions">
				<input id="submit_btn" class="btn btn-primary" type="submit" value="提交"/>&nbsp;	
				<input id="cancel_btn" class="btn" type="button" value="返回" onclick="history.back()"/>
			</div>
		</fieldset>
	</form>
</body>
</html>
